package com.qingxin.wuye.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

import com.qingxin.sys.entity.SysUser;

/**
 * SysUserGardenRel entity. 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_user_garden_rel")
public class SysUserGardenRel extends com.qingxin.sys.entity.BaseEntity
		implements java.io.Serializable {
	private static final long serialVersionUID = 1880526759985235266L;
	// Fields

	private String id;
	private WyGarden wyGarden;
	private SysUser sysUser;
	private String createBy;
	private Date createTime;

	// Constructors

	/** default constructor */
	public SysUserGardenRel() {
	}

	/** full constructor */
	public SysUserGardenRel(WyGarden wyGarden, SysUser sysUser,
			String createBy, Date createTime) {
		this.wyGarden = wyGarden;
		this.sysUser = sysUser;
		this.createBy = createBy;
		this.createTime = createTime;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "gardenid")
	public WyGarden getWyGarden() {
		return this.wyGarden;
	}

	public void setWyGarden(WyGarden wyGarden) {
		this.wyGarden = wyGarden;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid")
	public SysUser getSysUser() {
		return this.sysUser;
	}

	public void setSysUser(SysUser sysUser) {
		this.sysUser = sysUser;
	}

	@Column(name = "create_by", length = 50)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

}